// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file camera_trigger.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "camera_trigger.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

camera_trigger::camera_trigger()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_timestamp_utc_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_timestamp_utc_ = 0;
    // m_seq_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_seq_ = 0;
    // m_feedback_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_feedback_ = false;

}

camera_trigger::~camera_trigger()
{




}

camera_trigger::camera_trigger(const camera_trigger &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_feedback_ = x.m_feedback_;
}

camera_trigger::camera_trigger(camera_trigger &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_feedback_ = x.m_feedback_;
}

camera_trigger& camera_trigger::operator=(const camera_trigger &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_feedback_ = x.m_feedback_;

    return *this;
}

camera_trigger& camera_trigger::operator=(camera_trigger &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_feedback_ = x.m_feedback_;

    return *this;
}

size_t camera_trigger::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

size_t camera_trigger::getCdrSerializedSize(const camera_trigger& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

void camera_trigger::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_timestamp_utc_;
    scdr << m_seq_;
    scdr << m_feedback_;
}

void camera_trigger::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_timestamp_utc_;
    dcdr >> m_seq_;
    dcdr >> m_feedback_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void camera_trigger::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t camera_trigger::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& camera_trigger::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member timestamp_utc_
 * @param _timestamp_utc_ New value for member timestamp_utc_
 */
void camera_trigger::timestamp_utc_(uint64_t _timestamp_utc_)
{
m_timestamp_utc_ = _timestamp_utc_;
}

/*!
 * @brief This function returns the value of member timestamp_utc_
 * @return Value of member timestamp_utc_
 */
uint64_t camera_trigger::timestamp_utc_() const
{
    return m_timestamp_utc_;
}

/*!
 * @brief This function returns a reference to member timestamp_utc_
 * @return Reference to member timestamp_utc_
 */
uint64_t& camera_trigger::timestamp_utc_()
{
    return m_timestamp_utc_;
}

/*!
 * @brief This function sets a value in member seq_
 * @param _seq_ New value for member seq_
 */
void camera_trigger::seq_(uint32_t _seq_)
{
m_seq_ = _seq_;
}

/*!
 * @brief This function returns the value of member seq_
 * @return Value of member seq_
 */
uint32_t camera_trigger::seq_() const
{
    return m_seq_;
}

/*!
 * @brief This function returns a reference to member seq_
 * @return Reference to member seq_
 */
uint32_t& camera_trigger::seq_()
{
    return m_seq_;
}

/*!
 * @brief This function sets a value in member feedback_
 * @param _feedback_ New value for member feedback_
 */
void camera_trigger::feedback_(bool _feedback_)
{
m_feedback_ = _feedback_;
}

/*!
 * @brief This function returns the value of member feedback_
 * @return Value of member feedback_
 */
bool camera_trigger::feedback_() const
{
    return m_feedback_;
}

/*!
 * @brief This function returns a reference to member feedback_
 * @return Reference to member feedback_
 */
bool& camera_trigger::feedback_()
{
    return m_feedback_;
}


size_t camera_trigger::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;







    return current_align;
}

bool camera_trigger::isKeyDefined()
{
   return false;
}

void camera_trigger::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
}
